/*
 * Copyright (C) 2013 rothens
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package rpg.gfx.dialogs;

import rpg.ui.components.ComponentGradientButton;
import rpg.ui.components.ComponentTextarea;
import rpg.ui.components.StaticTextures;

/**
 *
 * @author rothens
 */
public class DialogCancelButton extends Dialog {

    public DialogCancelButton(Integer x, Integer y, ComponentTextarea text) {
        super(text.width+10, text.height+45, x, y);
        components.add(text);
        int[] colors = {0xffff00};
        components.add(new ComponentGradientButton(100, 30, width/2-50, height-35, StaticTextures.button_gradients, "Mégse", colors, (byte)2){
            @Override
            public void action() {
                onCancel();
            }            
        });
    }
    
    public void onCancel(){
        DialogFactory.getInstance().closeDialog();
    }
    
    
    
}
